<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/inc/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>会员管理</title>
	
	<link type="text/css" rel="stylesheet" href="${path }/js/easyui/themes/default/easyui.css">
	<link type="text/css" rel="stylesheet" href="${path }/css/button/button.css">
	<link type="text/css" rel="stylesheet" href="${path }/css/button/icon.css">
	<script type="text/javascript" src="${path }/js/jquery-1.4.2.min.js"></script>
	<script type="text/javascript" src="${path }/js/easyui/jquery.easyui.min.js"></script>
	<script type="text/javascript" src="${path }/js/easyui/locale/easyui-lang-zh_CN.js"></script>
	<script type="text/javascript">
		var path = "${path}";
	</script>
	
	<script language="javascript" src="${path }/js/button/button.js"></script>
	<script type="text/javascript" src="${path }/js/dialog/zDialog.js"></script>
	<script type="text/javascript" src="${path }/js/dialog/zDrag.js"></script>
	<script type="text/javascript" src="${path }/js/app/order.js"></script>
	<script type="text/javascript">	
		
		var grid;
		$(function(){
			grid = $('#list-table').datagrid({
				
				url:path + '/order/my/list/${member.memberName}',
				title:'申请列表',
				width:590,
				height:490,
				singleSelect:true,
				pagination:true,
				columns:fields
			});
			
		});
		
		
		
		function del(){
			var row = grid.datagrid('getSelected');
			if (row){
				var orderId = row.orderId;
				var url = "${path}/admin/order/del/"+orderId;
				if(confirm("确定要删除该申请!")){
					$.post(
						url,
						function(json){
							if(json.result == "Success"){
								alert("所选申请已删除!");
								refresh();
							}
							
						},
						'json'
					);
				}
				
			} else {
				$.messager.alert('警告','请先选择申请!','error');
			}
		}
		
		function pay(){
			var row = grid.datagrid('getSelected');
			if (row){
				var orderNo = row.orderNo;
				var url = "/pay/index?orderNo="+orderNo+"&orderType=1";
				window.location = url;
			} else {
				$.messager.alert('警告','请先选择申请!','error');
			}
		}
		
		
		
		function refresh(){
			grid.datagrid('reload');
		}
		
	</script>
	
	
</head>
<body>
	
	<table>
		<tr>
			
			
			<td>
				<input type='button' value="付款" onclick="pay()">
			</td>
			
			<td>
				<input  type='button' value='取消' onclick="del()"/>
			</td>
		</tr>	
	</table>
	
	<table id="list-table">
		
	</table>
	
</body>
</html>